#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
using namespace std;

struct Greater
{
    bool operator()(const pair<string, int>& p1, const pair<string, int>& p2)
    {
        return p1.second > p2.second;
    }
};
int main() {
    string s;
    getline(cin, s);
    map<string, int> m;
    string subs = "";

    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == ' ' || s[i] == '.')
        {
            for (int j = 0; j < subs.size(); j++)
            {
                if (isupper(subs[0]))
                    subs[0] = tolower(subs[0]);

            }
            m[subs]++;
            subs = "";
        }
        else
        {
            subs += s[i];
        }
    }
    vector<pair<string, int>> v(m.begin(), m.end());
    stable_sort(v.begin(), v.end(), Greater());
    for (auto e : v)
    {
        cout << e.first << ":" << e.second << endl;
    }
    return 0;
}